package com.supermarket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.supermarket.entity.Bill;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BillMapper extends BaseMapper<Bill> {
    List<Bill> getBillList(int start, Integer pageSize, String billCode, String productName, String proName);

    int getBillCount(String billCode, String productName, String proName);

    void updateBill(Bill bill);

    void deleteById(Long id);

    Bill getBillById(Long id);
    
    // 统计方法
    int getBillCountByDate(@Param("date") String date);
    
    int getBillCountByDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate);
    
    // 获取指定日期的账单总金额
    Double getTotalAmountByDate(@Param("date") String date);
    
    // 获取指定日期范围的账单总金额
    Double getTotalAmountByDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
